﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Rainbow.model
{
    public class ConnectInfoViewModel : ViewModelBase
    {
        public ConnectInfoViewModel()
        {
            this.host = "";
            this.port = 22;
            this.username = "";
            this.passPhrase = "";
        }

        public ConnectInfoViewModel(ConnectInfo info)
        {
            this.name = info.name;
            this.host = info.host;
            this.port = info.port;
            this.username = info.username;
            this.passPhrase = info.passPhrase;
            this.privateKeyFileName = info.privateKeyFileName;
        }

        public ConnectInfoViewModel(ConnectInfoViewModel info)
        {
            this.name = info.name;
            this.host = info.host;
            this.port = info.port;
            this.username = info.username;
            this.passPhrase = info.passPhrase;
            this.privateKeyFileName = info.privateKeyFileName;
        }

        public void Copy(ConnectInfoViewModel info)
        {
            this.name = info.name;
            this.host = info.host;
            this.port = info.port;
            this.username = info.username;
            this.passPhrase = info.passPhrase;
            this.privateKeyFileName = info.privateKeyFileName;
        }

        public ConnectInfoViewModel Clone()
        {
            return new ConnectInfoViewModel(this);
        }

        private string m_name;
        public string name
        {
            get { return m_name; }
            set
            {
                m_name = value;
                NotifyPropertyChanged();
            }
        }

        private string m_host;
        public string host
        {
            get { return m_host; }
            set
            {
                m_host = value;
                NotifyPropertyChanged();
            }
        }

        private int m_port;
        public int port
        {
            get { return m_port; }
            set
            {
                m_port = value;
                NotifyPropertyChanged();
            }
        }

        private string m_username;
        public string username
        {
            get { return m_username; }
            set
            {
                m_username = value;
                NotifyPropertyChanged();
            }
        }

        private string m_passPhrase;
        public string passPhrase
        {
            get { return m_passPhrase; }
            set
            {
                m_passPhrase = value;
                NotifyPropertyChanged();
            }
        }

        private string m_privateKeyFileName;
        public string privateKeyFileName
        {
            get { return m_privateKeyFileName; }
            set
            {
                m_privateKeyFileName = value;
                NotifyPropertyChanged();
            }
        }
    }
}
